home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vdtj122b.zip / DEMO4B.TXT < prev    next >
Text File  |  1992-10-25  |  964b  |  36 lines

  1. ;
  2. ;    -- Typical Assembly language subroutines --
  3. ;
  4. ; FILL - Fill 'CX' locations with 'AL' starting at (BX).
  5. ;     Return: BX = BX + CX; DX saved.
  6. ;
  7. FILL:    PUSH    DX        ;Save DX
  8.     MOV    DL,AL        ;Save char in DL
  9.     JCXZ    #1        ;Just return if CX == 0
  10. ;
  11.     MOV    [BX],DL        ;Fill first location
  12.     MOV    DX,BX        ;Move BX to DX
  13.     INC    DX        ;DX is Move destination
  14.     DEC    CX        ;Account for one filled pos
  15.     CALL    MOVEBC        ;Fill is overlapped block-move
  16.     MOV    BX,DX        ;BX-> past last fill
  17. #1:    POP    DX
  18.     RET
  19. ;
  20. ; CONVUC - Convert lower case letter in 'AL' to upper case.
  21. ;
  22. CONVUC:    CMP    AL,'a'        ;Is char at least a 'a'?
  23.     RC            ;No, not lower case
  24.     CMP    AL,'z'+1    ;Is char greater than 'z'?
  25.     RNC            ;Yes, not lower case
  26.     AND    AL,5FH        ;Else convert lower to upper case
  27.     RET
  28. ;
  29. ; REVCAS - Reverse upper/lower case for letters.
  30. ;
  31. REVCAS:    CALL    LETCHK        ;Is the char a letter?
  32.     JNZ    #1        ;No, don't change it
  33.     XOR    AL,020H        ;Reverse upper and lower case
  34. #1:    MOV    CL,AL        ;Also return char in C
  35.     RET
  36.